package com.zuoye;

import java.util.Scanner;

public class Demo5 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);//构建输入对象
        System.out.print("请输入税前工资:");
        double money1 = input.nextInt();//获取税前工资
        double money2 = money1 * 0.9-5000;//交完三险一金且多于5000的部分
        double shui = 0;//税
        if (money2>0 &&money2<=3000){
            shui = money2 * 0.03;
        }else if (money2>3000 && money2<=12000){
            shui = (money2-3000)*0.1+3000*0.03;
        }else if (money2>12000 && money2<=25000){
            shui = (money2-12000)*0.2+3000*0.03+9000*0.1;
        }else if (money2>25000 && money2<=35000){
            shui = (money2-25000)*0.25+3000*0.03+9000*0.1+13000*0.2;
        }else if (money2>35000 && money2<=55000){
            shui = (money2-35000)*0.3+3000*0.03+9000*0.1+13000*0.2
                    +10000*0.25;
        }else if (money2>55000 && money2<=80000){
            shui = (money2-55000)*0.35+3000*0.03+9000*0.1+13000*0.2
                    +10000*0.25+20000*0.3;
        }else if (money2>80000){
            shui = (money2-80000)*0.45+3000*0.03+9000*0.1+13000*0.2
                    +10000*0.25+20000*0.3+25000*0.35;
        }else {
            shui = 0;
        }
        double shuihou = money1 * 0.9 - shui;//计算税后工资
        System.out.println("应纳税: " + shui);
        System.out.println("税后工资： " + shuihou);

    }
}
